let Logger = require('./logger/logger');
let utils = require('./logger/utils');
const FileTransport = require('./logger/transports/file');
const FileBufferTransport = require('./logger/transports/file_buffer');
const ConsoleTransport = require('./logger/transports/console');
const path=require('path');

function createLogger(loggerPath){
    const logger = new Logger();

    logger.set('file', new FileBufferTransport({
      file: loggerPath,
      formatter: utils.defaultFormatter
    }));

    logger.set('console', new ConsoleTransport({
      level: 'INFO',
      formatter: utils.consoleFormatter,
    }));

    return logger;
}

module.exports =createLogger;